<template>
  <div class="question-all">
    <question-page :fetcher="fetchQuestions" @click-row="toShowQuestion"></question-page>
  </div>
</template>

<script>
import QuestionPage from '@/components/QuestionPage'
import api from '@/api'

export default {
  name: 'QuestionAll',
  components: {
    QuestionPage
  },
  methods: {
    fetchQuestions(page) {
      return api.queryQuestions({ status: null, style: null, content: null, is_me: null }, page)
    },
    toShowQuestion({ id }) {
      this.$router.push({
        name: 'question-show',
        params: {
          id
        }
      })
    }
  }
}
</script>
